package com.ms.dsq_english.adapter;

import android.graphics.Color;
import android.view.View;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ms.dsq_english.R;
import com.ms.dsq_english.model.SalesBean;

import java.util.List;

/**
 * @Description:
 * @Author: zheng
 */
public class SaleAdapter  extends BaseQuickAdapter<SalesBean.DataBean.SalesCategoryRateBean, BaseViewHolder> {
    public SaleAdapter(int layoutResId, @Nullable List<SalesBean.DataBean.SalesCategoryRateBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SalesBean.DataBean.SalesCategoryRateBean item) {
        helper.setText(R.id.text,item.getGoods_line_name());
        View view =  helper.getView(R.id.color_rec);
        view.setBackgroundColor(Color.parseColor(item.getColor()));
    }
}
